{extend name="admin@index_layout"/}
{block name="main"}
<div class="layui-card">
    <div class="layui-card-header">服务站提现审核</div>
    <div class="layui-card-body">
        <table class="layui-hide" id="currentTable" lay-filter="currentTable"></table>
    </div>
</div>
<script type="text/html" id="barTool">
    {if $status==0}
    <a onclick="wk.layer_show('提现审核','{:url('detail')}?id={{d.id}}&type=0',800)"
       class="layui-btn layui-bg-cyan layui-btn-xs" title="提现审核">提现审核</a>
    {/if}
    {if $status==1}
    <a onclick="wk.layer_show('提现审核','{:url('detail')}?id={{d.id}}&type=1',800)"
       class="layui-btn layui-bg-cyan layui-btn-xs" title="提现审核">查看提现信息</a>
    {/if}


</script>
{/block}
{block name="script"}
<script>
    layui.use(['yznTable','table'], function () {
        var table = layui.yznTable;
        var init = {
            table_elem: '#currentTable',
            table_render_id: 'currentTable',
            add_url: "{:url('add')}",
            edit_url: "{:url('edit')}",
            delete_url: "{:url('del')}",
        };
        table.render({
            elem: '#currentTable',
            autoWidth: true,
            toolbar: ['refresh',],
            url: '{:url("index")}?status={$status}',
            init: init,
            cols: [
                [
                    {type: 'checkbox', fixed: 'left'},
                    {field: 'id', width: 50, title: 'ID'},
                    {field: 'business_name', Width: 110, title: '服务站名称'},
                    {field: 'phone', Width: 120, title: '联系电话'},
                    {field: 'amount', Width: 120, title: '提现金额'},
                    {
                        field: 'status', Width: 90, title: '审核状态', templet: function (d) {
                            if (d.status == 1) {
                                return '<span style="color: green">审核通过</span>';
                            } else {
                                return '<span style="color: red">待审核</span>';
                            }
                        }
                    },
                    {field: 'create_time', Width: 150, title: '提现时间'},
                    {field: 'status_time', Width: 150, title: '审核通过时间'},
                    {fixed: 'right', align: 'center', Width: 50, title: '操作', toolbar: '#barTool'}//delete'
                ]
            ],
            page: {}
        });
        table.bindevent();
    });
</script>
{/block}